/*
 * Copyright 2008-2009 Aying.Net Powered by Fuchun.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.aying.media.audio;

/**
 * {@code Audio} 音频接口 {@code MP3} 音频的实现。
 * 
 * @author Fuchun
 * @version 1.0, 2009-07-21
 */
public class AudioMP3 implements Audio {

    /** 默认的串行化版本标识。 */
    private static final long serialVersionUID = 1L;

    /**
     * {@code MP3} 文件的头部固定标签信息。
     */
    public static final String MP3_TAG = "TAG";
    
    /** {@code MP3} 文件的头部信息的编码。*/
    public static final String MP3_ENCODING = "Cp437";

    /** {@code MP3} 文件的信息字节数。 */
    public static final int TAG_SIZE = 128;

    /** {@code MP3} 文件的标题信息所占字节数。 */
    public static final int TITLE_LEN = 30;

    /** {@code MP3} 文件的艺术家信息所占字节数。 */
    public static final int ARTIST_LEN = 30;

    /** {@code MP3} 文件的专辑信息所占字节数。 */
    public static final int ALBUM_LEN = 30;

    /** {@code MP3} 文件的年份信息所占字节数。 */
    public static final int YEAR_LEN = 4;

    /** {@code MP3} 文件的备注信息所占字节数。 */
    public static final int COMMENT_LEN = 29;

    /** {@code MP3} 文件的音轨信息的索引位置。 */
    public static final int TRACK_LOCATION = 126;

    /** {@code MP3} 文件的音乐风格信息的索引位置。 */
    public static final int GENRE_LOCATION = 127;

    /* mp3标题 */
    private String title;

    /* mp3艺术家 */
    private String artist;

    /* mp3专辑 */
    private String album;

    /* mp3声道 */
    private String channel;

    /* mp3比特率 */
    private Integer bitrate;

    /* mp3频率 */
    private Integer frequency;

    /* mp3码率 */
    private Integer kbps;

    /* mp3长度 */
    private Integer length;

    /* mp3音轨 */
    private Integer track;

    /**
     * @see net.aying.media.audio.Audio#getAlbum()
     */
    public String getAlbum() {
        return album;
    }

    /**
     * @see net.aying.media.audio.Audio#setAlbum(java.lang.String)
     */
    public void setAlbum(String album) {
        this.album = album;
    }

    /**
     * @see net.aying.media.audio.Audio#getArtist()
     */
    public String getArtist() {
        return artist;
    }

    /**
     * @see net.aying.media.audio.Audio#setArtist(java.lang.String)
     */
    public void setArtist(String artist) {
        this.artist = artist;
    }

    /**
     * @see net.aying.media.audio.Audio#getAudioFormat()
     */
    public AudioFormat getAudioFormat() {
        return AudioFormat.MP3;
    }

    /**
     * @see net.aying.media.audio.Audio#getBitrate()
     */
    public Integer getBitrate() {
        return bitrate;
    }

    public void setBitrate(Integer bitrate) {
        this.bitrate = bitrate;
    }

    /**
     * @see net.aying.media.audio.Audio#getChannel()
     */
    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    /**
     * @see net.aying.media.audio.Audio#getFrequency()
     */
    public Integer getFrequency() {
        return frequency;
    }

    public void setFrequency(Integer frequency) {
        this.frequency = frequency;
    }

    /**
     * @see net.aying.media.audio.Audio#getKbps()
     */
    public Integer getKbps() {
        return kbps;
    }

    public void setKbps(Integer kbps) {
        this.kbps = kbps;
    }

    /**
     * @see net.aying.media.audio.Audio#getLength()
     */
    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    /**
     * @see net.aying.media.audio.Audio#getTitle()
     */
    public String getTitle() {
        return title;
    }

    /**
     * @see net.aying.media.audio.Audio#setTitle(java.lang.String)
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * @see net.aying.media.audio.Audio#getTrack()
     */
    public Integer getTrack() {
        return track;
    }

    public void setTrack(Integer track) {
        this.track = track;
    }
}
